﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace IcqSharp
{
    public static class Contacts
    {
        private static List<Contact> contacts = 
                   new List<Contact>();

        public static Contact Find(UInt32 UIN)
        {
            return contacts.SingleOrDefault(c => c.UIN == UIN);
        }
        public static Contact Find(String UID)
        {
            return contacts.SingleOrDefault(c => c.UID == UID);
        }
        public static Contact Find(UInt32 UIN, String UID)
        {
            if (UIN != 0) return Find(UIN);
            else if (UID != null) return Find(UID);
            else return null;
        }


    }

    public class Contact
    {

        public UInt32 UIN;
        public String UID;

        public String About;

        public UInt16 Status;

        public List<Capability> Capabilities;

        public String Client = "not yet detected";

        public DateTime MemberSince;
        public DateTime OnlineSince;
        public DateTime AwaySince;
        public DateTime Idle;

        public UInt32 DirectCookie;
        public Byte DCType;
        public UInt16 UserPort;
        public UInt16 Version;

        public IPAddress IP;
        public IPAddress RealIP;

    }


}
